Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

[19.03 backport] Windows: Use system specific parallelism value on containers restart#423

Merged
thaJeztah merged 1 commit into
docker-archive:19.03from
thaJeztah:19.03_backport_win_restore_no_parallelism
Jan 16, 2020
Merged

[19.03 backport] Windows: Use system specific parallelism value on containers restart#423
thaJeztah merged 1 commit into
docker-archive:19.03from
thaJeztah:19.03_backport_win_restore_no_parallelism

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

backport of moby#39733

- What I did
moby#38301 did set container restart/restore task parallelism limit to 128*NumCPU which is good limit for Linux containers. Especially when they are made correctly by following one process per container rule.

However Windows containers are much heavier and example Windows Server 2019 base image mcr.microsoft.com/windows/servercore:ltsc2019 it selves includes ~20 system processes which causes restoring to generate so high load to server and it cannot response anything else until restore is completed.

- How I did it
Disabled restore parallelism from Windows platform.

- How to verify it
I created 100 containers with restart policy:

for($i=1;$i -le 100;$i++) {
	docker run -d --restart always --network nat mcr.microsoft.com/windows/servercore:ltsc2019 ping -t 127.0.0.1
	start-sleep -seconds 10
}

On my 4 CPU test machine it they take about 8 minutes to restart with and without this changes.
However there is big difference how server is able to response to other commands.

Without this change CPU load is constantly 100% and even typing text to notepad takes long time:
without_patch_restore

After this change server still uses all CPU it have now it still responses to user input.
docker_restart_parallel_1

- A picture of a cute animal (not mandatory but encouraged)
image

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
(cherry picked from commit 447a840)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Copy Markdown

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
Copy link
Copy Markdown
Member Author

@kolyshkin @andrewhsu @ddebroy PTAL

Copy link
Copy Markdown

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faithful backport, LGTM 👍

$ diff -u <(wget -qO- 'https://github.com/moby/moby/pull/39733.diff') <(wget -qO- 'https://github.com/docker/engine/pull/423.diff')
--- /dev/fd/63	2019-11-26 14:15:58.943354427 -0800
+++ /dev/fd/62	2019-11-26 14:15:58.943354427 -0800
@@ -1,5 +1,5 @@
 diff --git a/daemon/daemon_windows.go b/daemon/daemon_windows.go
-index f7d557fb8495..85a1d43ed596 100644
+index f6d0f8c6ced7..495f7788cb11 100644
 --- a/daemon/daemon_windows.go
 +++ b/daemon/daemon_windows.go
 @@ -3,7 +3,9 @@ package daemon // import "github.com/docker/docker/daemon"
@@ -12,7 +12,7 @@
  	"strings"
  
  	"github.com/Microsoft/hcsshim"
-@@ -41,9 +43,10 @@ const (
+@@ -40,9 +42,10 @@ const (
  	windowsMaxCPUPercent = 100
  )
  
$ 

olljanat added a commit to olljanat/moby that referenced this pull request Nov 27, 2019
@thaJeztah thaJeztah merged commit 1a451ca into docker-archive:19.03 Jan 16, 2020
@thaJeztah thaJeztah deleted the 19.03_backport_win_restore_no_parallelism branch January 16, 2020 20:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants